<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>局部过滤器</title>
    <script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
</head>
<body>
<div id="case7-demo3">
    <p>{{message|dateFormat}}</p>
</div>
<script type="text/javascript">
    var case7Demo3=new Vue({
        el:"#case7-demo3",
        data:{
            message:""
        },
        filters:{
            dateFormat:()=>{
                var now=new Date();
                var time_now="现在是" + now.getFullYear() + "年" + (now.getMonth() + 1) + "月" + now.getDate() + "日" + now.getHours() + "时" + now.getMinutes() + "分" + now.getSeconds() + "秒";
                return time_now
            }
        }
    })
</script>
</body>
</html>